-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[김병화] Week6 #261
base: part2-김병화
Are you sure you want to change the base?
The head ref may contain hidden characters: "part2-\uAE40\uBCD1\uD654-week6"
[김병화] Week6 #261
Conversation
const userName = user?.name; | ||
const userEmail = user?.email; | ||
const userProfileImg = user?.profileImageSource; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const {name = "", email = "", profileImageSource = ""} = user;
function Card({ link }: CardProps) { | ||
const getCreatedTime = () => { | ||
const splitedCreatedAt = link.createdAt.split('-'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아래 58~63번 라인까지의 코드는 앞으로 쓸일이 많아보이네요. /src/utils
로 빼서 사용해주시면 됩니다. getFormatedDate()
return createdTime; | ||
}; | ||
|
||
const getCreatedBefore = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 친구도 /src/utils
로 빼주시면 될 것 같습니다.
let createdBeforeMessage = ''; | ||
|
||
const splitedCreatedAt = link.createdAt.split('T'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const [year, month, day] = splitedCreatedAt[0].split('-').map(val => Number(val));
const [hour, minute, second] = splitedCreatedAt[1].split(':').map((val, index) => index === 2 ? Number(val.substring(0,2)) : Number(val) );
const createdDate = new Date(year, month, day, hour, minute, second);
요구사항
기본
// 반응형 미구현